def func():
    passwd = input("请输入密码：")
    num1 = [2, 1, 1, 1]
    num2 = [0, 0, 0, 0]
    if len(passwd) < 8:
        num1[1] = 0
    for i in passwd:
        if i.isupper():
            num2[0] = 1
        elif i.islower():
            num2[1] = 1
        elif i.isdigit():
            num2[2] = 1
        else:
            num2[3] = 1
    if sum(num2) < 3:
        num1[2] = 0
    for n in range(len(passwd)-3):
        if passwd[n:n+3] in passwd[n+1:]:
            num1[3] = 0
    print("设置成功，密码复杂度为", sum(num1))
    if num1[1] != 1:
        print("密码长度小于8")
    if num1[2] != 1:
        print("密码未由三种以上字符组成")
    if num1[3] != 1:
        print("密码中出现重复子串")

func()